/* @(#)FmmDecKanGlDictionary.java
** 
** Copyright (C) 2012 by Steven D. Stamps
**
**             Trademarks & Copyrights
** Flywheel Management Science(TM), Flywheel Management Model(TM),
** Flywheel Story Editor(TM) and FlywheelMS(TM) are exclusive trademarks
** of Steven D. Stamps and may only be used freely for the purpose of
** identifying the unforked version of this software.  Subsequent forks
** may not use these trademarks.  All other rights are reserved.
** and FlywheelMS(TM) are exclusive trademarks of Steven D. Stamps
** and may only be used freely for the purpose of identifying the
** unforked version of this software.  Subsequent forks (if any) may
** not use these trademarks.  All other rights are reserved.
**
** DecKanGL (Decorated Kanban Glyph Language) and TribKn (Tribal Knowledge)
** are also exclusive trademarks of Steven D. Stamps.  These may be used
** freely within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** gConGUI (game Controller Graphical User Interface) is an exclusive
** trademark of Steven D. Stamps.  This trademark may be used freely
** within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** Trademark information is available at
** <http://www.flywheelms.com/trademarks>
**
** Flywheel Management Science(TM) is a copyrighted body of management
** metaphors, governance processes, and leadership techniques that is
** owned by Steven D. Stamps.  These copyrighted materials may be freely
** used, without alteration, by the community (users and developers)
** surrounding this GPL3-licensed software.  Additional copyright
** information is available at <http://www.flywheelms.org/copyrights>
**
**              GPL3 Software License
** This program is free software: you can use it, redistribute it and/or
** modify it under the terms of the GNU General Public License, version 3,
** as published by the Free Software Foundation. This program is distributed
** in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
** even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
** PURPOSE.  See the GNU General Public License for more details. You should
** have received a copy of the GNU General Public License, in a file named
** COPYING, along with this program.  If you cannot find your copy, see
** <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.flywheelms.library.fmm.deckangl;

import java.util.HashMap;
import java.util.LinkedHashMap;

import com.flywheelms.library.FmsLibraryApplication;
import com.flywheelms.library.R;
import com.flywheelms.library.deckangl.enumerator.DecoratorCanvasLocation;
import com.flywheelms.library.deckangl.enumerator.WorkStateColor;
import com.flywheelms.library.deckangl.glyph.DecKanGlDictionary;
import com.flywheelms.library.deckangl.glyph.NounDefinition;
import com.flywheelms.library.deckangl.glyph.TribKnQualityMetric;
import com.flywheelms.library.deckangl.glyph.WorkStatus;
import com.flywheelms.library.fmm.node.impl.enumerator.FmmNodeDictionary;

public class FmmDecKanGlDictionary extends DecKanGlDictionary {

	/*
	 * WARNING - update this static variable when changing package structure for the application's decorator classes
	 */
	private static final String DECORATOR_PACKAGE_NAME = "com.flywheelms.library.fmm.deckangl";
	
	// completable nodes.  aka - work status nodes with quality metrics
	public static final String noun_BOOKSHELF = FmmNodeDictionary.BOOKSHELF.getName();
	public static final String noun_DISCUSSION_TOPIC = FmmNodeDictionary.DISCUSSION_TOPIC.getName();
	public static final String noun_FACILITATION_ISSUE = FmmNodeDictionary.FACILITATION_ISSUE.getName();
	public static final String noun_FISCAL_YEAR = FmmNodeDictionary.FISCAL_YEAR.getName();
	public static final String noun_FLYWHEEL_MILESTONE = FmmNodeDictionary.FLYWHEEL_MILESTONE.getName();
	public static final String noun_NOTEBOOK = FmmNodeDictionary.NOTEBOOK.getName();
	public static final String noun_PORTFOLIO = FmmNodeDictionary.PORTFOLIO.getName();
	public static final String noun_PROJECT = FmmNodeDictionary.PROJECT.getName();
	public static final String noun_PROJECT_ASSET = FmmNodeDictionary.PROJECT_ASSET.getName();
	public static final String noun_SERVICE_REQUEST = FmmNodeDictionary.SERVICE_REQUEST.getName();
	public static final String noun_SERVICE_REQUEST_TRIAGE_LOG = FmmNodeDictionary.SERVICE_REQUEST_TRIAGE_LOG.getName();
	public static final String noun_STRATEGIC_MILESTONE = FmmNodeDictionary.STRATEGIC_MILESTONE.getName();
	public static final String noun_WORK_PACKAGE = FmmNodeDictionary.WORK_PACKAGE.getName();
	public static final String noun_WORK_PLAN = FmmNodeDictionary.WORK_PLAN.getName();
	public static final String noun_WORK_TASK = FmmNodeDictionary.WORK_TASK.getName();
	
			// community nodes - no completable work status
			public static final String noun_COMMUNITY_MEMBER = FmmNodeDictionary.COMMUNITY_MEMBER.getName();
			public static final String noun_FLYWHEEL_TEAM = FmmNodeDictionary.FLYWHEEL_TEAM.getName();
			public static final String noun_FUNCTIONAL_TEAM = FmmNodeDictionary.FUNCTIONAL_TEAM.getName();
			public static final String noun_ORGANIZATION = FmmNodeDictionary.ORGANIZATION.getName();
			public static final String noun_STRATEGIC_TEAM = FmmNodeDictionary.STRATEGIC_TEAM.getName();
			
			// commitment nodes - no completable work status (other status), quality metrics
			public static final String noun_SERVICE_DELIVERY_COMMITMENT = FmmNodeDictionary.SERVICE_DELIVERY_COMMITMENT.getName();
			
			// no completable work status, just quality metrics
			public static final String noun_SERVICE_OFFERING = FmmNodeDictionary.SERVICE_OFFERING.getName();
			public static final String noun_SERVICE_OFFERING_SLA = FmmNodeDictionary.SERVICE_OFFERING_SLA.getName();
	
	public static final String status_WORK_NOT_STARTED = "Work Not Started";
	public static final String status_WORK_HAS_STARTED = "Work Has Started";
	public static final String status_WORK_ON_HOLD = "Work On Hold";
	public static final String status_WORK_IS_COMPLETE = "Work Is Complete";

	public static final String tribKn_CHILD_FRACTALS = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__child_fractals);
	public static final String tribKn_COMPLETION = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__completion);
	public static final String tribKn_FACILITATOR = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__facilitator);
	public static final String tribKn_FACILITATION_ISSUE = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__facilitation_issue);
	public static final String tribKn_FLYWHEEL_COMMITMENT = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__flywheel_commitment);
	public static final String tribKn_GOVERNANCE = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__governance);
	public static final String tribKn_PARENT_FRACTALS = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__parent_fractals);
	public static final String tribKn_STORY = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__story);
	public static final String tribKn_STRATEGIC_COMMITMENT = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__strategic_commitment);
	public static final String tribKn_WORK_TASK_BUDGET = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__work_task_budget);
	public static final String tribKn_WORK_TEAM = FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__work_team);
	
	private FmmDecKanGlDictionary() {
		super();
	}
	
	public static DecKanGlDictionary getInstance() {
		if (instance == null) {
			instance = new FmmDecKanGlDictionary();
		}
		return instance;
	}

	@Override
	protected LinkedHashMap<String, NounDefinition> buildNounDefinitionMap() {
		LinkedHashMap<String, NounDefinition> theNounDefinitionMap = new LinkedHashMap<String, NounDefinition>();
		theNounDefinitionMap.put(noun_BOOKSHELF, new NounDefinition(FmmNodeDictionary.BOOKSHELF.getName(), new Integer[] {
			R.drawable.fmm_noun__bookshelf__gray,
			R.drawable.fmm_noun__bookshelf__yellow,
			R.drawable.fmm_noun__bookshelf__orange,
			R.drawable.fmm_noun__bookshelf__pink,
			R.drawable.fmm_noun__bookshelf__green } ));
		theNounDefinitionMap.put(noun_DISCUSSION_TOPIC, new NounDefinition(FmmNodeDictionary.DISCUSSION_TOPIC.getName(), new Integer[] {
			R.drawable.fmm_noun__discussion_topic__gray,
			R.drawable.fmm_noun__discussion_topic__yellow,
			R.drawable.fmm_noun__discussion_topic__orange,
			R.drawable.fmm_noun__discussion_topic__pink,
			R.drawable.fmm_noun__discussion_topic__green } ));
		theNounDefinitionMap.put(noun_FACILITATION_ISSUE, new NounDefinition(FmmNodeDictionary.FACILITATION_ISSUE.getName(), new Integer[] {
			R.drawable.fmm_noun__facilitation_issue__gray,
			R.drawable.fmm_noun__facilitation_issue__yellow,
			R.drawable.fmm_noun__facilitation_issue__orange,
			R.drawable.fmm_noun__facilitation_issue__pink,
			R.drawable.fmm_noun__facilitation_issue__green } ));
		theNounDefinitionMap.put(noun_FISCAL_YEAR, new NounDefinition(FmmNodeDictionary.FISCAL_YEAR.getName(), new Integer[] {
			R.drawable.fmm_noun__fiscal_year__gray,
			R.drawable.fmm_noun__fiscal_year__yellow,
			R.drawable.fmm_noun__fiscal_year__orange,
			R.drawable.fmm_noun__fiscal_year__pink,
			R.drawable.fmm_noun__fiscal_year__green } ));
		theNounDefinitionMap.put(noun_FLYWHEEL_MILESTONE, new NounDefinition(FmmNodeDictionary.FLYWHEEL_MILESTONE.getName(), new Integer[] {
			R.drawable.fmm_noun__flywheel_milestone__gray,
			R.drawable.fmm_noun__flywheel_milestone__yellow,
			R.drawable.fmm_noun__flywheel_milestone__orange,
			R.drawable.fmm_noun__flywheel_milestone__pink,
			R.drawable.fmm_noun__flywheel_milestone__green } ));
		theNounDefinitionMap.put(noun_NOTEBOOK, new NounDefinition(FmmNodeDictionary.NOTEBOOK.getName(), new Integer[] {
			R.drawable.fmm_noun__notebook__gray,
			R.drawable.fmm_noun__notebook__yellow,
			R.drawable.fmm_noun__notebook__orange,
			R.drawable.fmm_noun__notebook__pink,
			R.drawable.fmm_noun__notebook__green } ));
		theNounDefinitionMap.put(noun_PORTFOLIO, new NounDefinition(FmmNodeDictionary.PORTFOLIO.getName(), new Integer[] {
			R.drawable.fmm_noun__portfolio__gray,
			R.drawable.fmm_noun__portfolio__yellow,
			R.drawable.fmm_noun__portfolio__orange,
			R.drawable.fmm_noun__portfolio__pink,
			R.drawable.fmm_noun__portfolio__green } ));
		theNounDefinitionMap.put(noun_PROJECT, new NounDefinition(FmmNodeDictionary.PROJECT.getName(), new Integer[] {
			R.drawable.fmm_noun__project__gray,
			R.drawable.fmm_noun__project__yellow,
			R.drawable.fmm_noun__project__orange,
			R.drawable.fmm_noun__project__pink,
			R.drawable.fmm_noun__project__green } ));
		theNounDefinitionMap.put(noun_PROJECT_ASSET, new NounDefinition(FmmNodeDictionary.PROJECT_ASSET.getName(), new Integer[] {
			R.drawable.fmm_noun__project_asset__gray,
			R.drawable.fmm_noun__project_asset__yellow,
			R.drawable.fmm_noun__project_asset__orange,
			R.drawable.fmm_noun__project_asset__pink,
			R.drawable.fmm_noun__project_asset__green } ));
		theNounDefinitionMap.put(noun_SERVICE_REQUEST, new NounDefinition(FmmNodeDictionary.SERVICE_REQUEST.getName(), new Integer[] {
			R.drawable.fmm_noun__service_request__gray,
			R.drawable.fmm_noun__service_request__yellow,
			R.drawable.fmm_noun__service_request__orange,
			R.drawable.fmm_noun__service_request__pink,
			R.drawable.fmm_noun__service_request__green } ));
		theNounDefinitionMap.put(noun_SERVICE_REQUEST_TRIAGE_LOG, new NounDefinition(FmmNodeDictionary.SERVICE_REQUEST_TRIAGE_LOG.getName(), new Integer[] {
			R.drawable.fmm_noun__service_request_triage_log__gray,
			R.drawable.fmm_noun__service_request_triage_log__yellow,
			R.drawable.fmm_noun__service_request_triage_log__orange,
			R.drawable.fmm_noun__service_request_triage_log__pink,
			R.drawable.fmm_noun__service_request_triage_log__green } ));
		theNounDefinitionMap.put(noun_STRATEGIC_MILESTONE, new NounDefinition(FmmNodeDictionary.STRATEGIC_MILESTONE.getName(), new Integer[] {
			R.drawable.fmm_noun__strategic_milestone__gray,
			R.drawable.fmm_noun__strategic_milestone__yellow,
			R.drawable.fmm_noun__strategic_milestone__orange,
			R.drawable.fmm_noun__strategic_milestone__pink,
			R.drawable.fmm_noun__strategic_milestone__green } ));
		theNounDefinitionMap.put(noun_WORK_PACKAGE, new NounDefinition(FmmNodeDictionary.WORK_PACKAGE.getName(), new Integer[] {
			R.drawable.fmm_noun__work_package__gray,
			R.drawable.fmm_noun__work_package__yellow,
			R.drawable.fmm_noun__work_package__orange,
			R.drawable.fmm_noun__work_package__pink,
			R.drawable.fmm_noun__work_package__green } ));
		theNounDefinitionMap.put(noun_WORK_PLAN, new NounDefinition(FmmNodeDictionary.WORK_PLAN.getName(), new Integer[] {
			R.drawable.fmm_noun__work_plan__gray,
			R.drawable.fmm_noun__work_plan__yellow,
			R.drawable.fmm_noun__work_plan__orange,
			R.drawable.fmm_noun__work_plan__pink,
			R.drawable.fmm_noun__work_plan__green } ));
		theNounDefinitionMap.put(noun_WORK_TASK, new NounDefinition(FmmNodeDictionary.WORK_TASK.getName(), new Integer[] {
			R.drawable.fmm_noun__work_task__gray,
			R.drawable.fmm_noun__work_task__yellow,
			R.drawable.fmm_noun__work_task__orange,
			R.drawable.fmm_noun__work_task__pink,
			R.drawable.fmm_noun__work_task__green } ));
		return theNounDefinitionMap;
	}
	
	public HashMap<String, WorkStatus> buildStatusMap() {
		HashMap<String, WorkStatus> theStatusMap = new HashMap<String, WorkStatus>();
		theStatusMap.put(status_WORK_NOT_STARTED, new WorkStatus(
				R.string.work_status__not_started,
				WorkStateColor.GRAY ));
		theStatusMap.put(status_WORK_HAS_STARTED, new WorkStatus(
				R.string.work_status__started,
				WorkStateColor.YELLOW ));
		theStatusMap.put(status_WORK_ON_HOLD, new WorkStatus(
				R.string.work_status__on_hold,
				WorkStateColor.PINK ));
		theStatusMap.put(status_WORK_IS_COMPLETE, new WorkStatus(
				R.string.work_status__work_complete__description,
				WorkStateColor.GREEN ));
		return theStatusMap;
	}
	
	@Override
	public LinkedHashMap<String, TribKnQualityMetric> buildTribKnQualityMetricMap() {
		LinkedHashMap<String, TribKnQualityMetric> theTribKnMap = new LinkedHashMap<String, TribKnQualityMetric>();
		theTribKnMap.put(tribKn_GOVERNANCE, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__governance,
				R.string.tribkn_quality_metric__governance__description,
				R.drawable.tribkn_quality_metric__governance,
				DecoratorCanvasLocation.top_zone_LEFT,
				DecoratorGovernance.class ));
		theTribKnMap.put(tribKn_FACILITATION_ISSUE, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__facilitation_issue,
				R.string.tribkn_quality_metric__facilitation_issue__description,
				R.drawable.tribkn_quality_metric__facilitation_issue,
				DecoratorCanvasLocation.top_zone_MIDDLE,
				DecoratorFacilitationIssue.class ));
		theTribKnMap.put(tribKn_FACILITATOR, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__facilitator,
				R.string.tribkn_quality_metric__facilitator__description,
				R.drawable.tribkn_quality_metric__facilitator,
				DecoratorCanvasLocation.top_zone_RIGHT,
				DecoratorFacilitator.class ));
		
		theTribKnMap.put(tribKn_PARENT_FRACTALS, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__parent_fractals,
				R.string.tribkn_quality_metric__parent_fractals__description,
				R.drawable.tribkn_quality_metric__parent_fractals,
				DecoratorCanvasLocation.left_zone_TOP,
				DecoratorParentFractals.class ));
		theTribKnMap.put(tribKn_STRATEGIC_COMMITMENT, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__strategic_commitment,
				R.string.tribkn_quality_metric__strategic_commitment__description,
				R.drawable.tribkn_quality_metric__strategic_commitment,
				DecoratorCanvasLocation.left_zone_MIDDLE,
				DecoratorStrategicCommitment.class ));
		theTribKnMap.put(tribKn_WORK_TASK_BUDGET, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__work_task_budget,
				R.string.tribkn_quality_metric__work_task_budget__description,
				R.drawable.tribkn_quality_metric__work_task_budget,
				DecoratorCanvasLocation.left_zone_BOTTOM,
				DecoratorWorkTaskBudget.class ));
		
		theTribKnMap.put(tribKn_CHILD_FRACTALS, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__child_fractals,
				R.string.tribkn_quality_metric__child_fractals__description,
				R.drawable.tribkn_quality_metric__parent_fractals,
				DecoratorCanvasLocation.right_zone_TOP,
				DecoratorChildFractals.class ));
		theTribKnMap.put(tribKn_FLYWHEEL_COMMITMENT, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__flywheel_commitment,
				R.string.tribkn_quality_metric__flywheel_commitment__description,
				R.drawable.tribkn_quality_metric__flywheel_commitment,
				DecoratorCanvasLocation.right_zone_MIDDLE,
				DecoratorFlywheelCommitment.class ));
		theTribKnMap.put(tribKn_WORK_TEAM, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__work_team,
				R.string.tribkn_quality_metric__work_team__description,
				R.drawable.tribkn_quality_metric__work_team,
				DecoratorCanvasLocation.right_zone_BOTTOM,
				DecoratorWorkTeam.class ));
		
		theTribKnMap.put(tribKn_STORY, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__story,
				R.string.tribkn_quality_metric__story__description,
				R.drawable.tribkn_quality_metric__story,
				DecoratorCanvasLocation.bottom_zone_LEFT,
				DecoratorStory.class ));
		theTribKnMap.put(tribKn_COMPLETION, new TribKnQualityMetric(
				R.string.tribkn_quality_metric__completion,
				R.string.tribkn_quality_metric__completion__description,
				R.drawable.tribkn_quality_metric__completion,
				DecoratorCanvasLocation.bottom_zone_RIGHT,
				DecoratorCompletion.class ));
		return theTribKnMap;
	}

	@Override
	public NounDefinition getNounDefinitionForName(String aName) {
		return getCompletableNounMap().get(aName);
	}

	@Override
	protected LinkedHashMap<String, WorkStatus> buildWorkStatusMap() {
		return null;
	}

	@Override
	public String getDecoratorsPackageName() {
		return FmmDecKanGlDictionary.DECORATOR_PACKAGE_NAME;
	}
	
}